package models

import (
	"gitee.com/lzqysoft/framework/common/tool"
	"time"
	"gitee.com/lzqysoft/framework/common/uuid"
)

type Canton struct {
	Id        string `xorm:"not null pk index unique VARCHAR(64)"`
	Onwer     string `xorm:"VARCHAR(64)"`
	Group     string `xorm:"VARCHAR(64)"`
	Creater   string `xorm:"VARCHAR(64)"`
	CreateAt  int64  `xorm:"BIGINT"`
	CreateOrg string `xorm:"VARCHAR(64)"`
	Updater   string `xorm:"VARCHAR(64)"`
	UpdateAt  int64  `xorm:"BIGINT"`
	Deleter   string `xorm:"VARCHAR(64)"`
	DeleteAt  int64  `xorm:"BIGINT"`
	Isdelete  string `xorm:"VARCHAR(2)"`
	Status    string `xorm:"VARCHAR(2)"`
	Remark    string `xorm:"VARCHAR(255)"`
	Operation int    `xorm:"INTEGER"`
	Obligate3 string `xorm:"VARCHAR(64)"`
	Obligate2 string `xorm:"VARCHAR(64)"`
	Obligate  string `xorm:"VARCHAR(64)"`
	Name      string `xorm:"VARCHAR(32)"`
	Code      string `xorm:"index VARCHAR(16)"`
	Pid       string `xorm:"VARCHAR(64)"`
}
func (v *Canton) TableName() string {
	return "base_canton"
}
func (v *Canton) BeforeInsert(){
	v.Id = uuid.UUID()
	v.CreateAt = time.Now().Unix()
	v.UpdateAt = time.Now().Unix()
}
func (v Canton) Convert2Map() map[string]interface{} {
	return tool.Struct2Map(v)
}